[broadway] When resyncing, first create all windows then set attributes
authorAlexander Larsson <alexl@redhat.com>
Mon, 11 Apr 2011 15:49:18 +0000 (17:49 +0200)
committerAlexander Larsson <alexl@redhat.com>
Tue, 12 Apr 2011 09:12:39 +0000 (11:12 +0200)
Some attributes (like transient parent) depende on other windows being
there, so we create all first.

gdk/broadway/gdkwindow-broadway.c

index 1cd54255967e1b2bb439d154610430490c7ce24c..34a1ae66314783b66ad056f26f4cdec499599211 100644 (file)
@@ -208,6 +208,7 @@ _gdk_broadway_resync_windows (void)
 
   display = GDK_BROADWAY_DISPLAY (gdk_display_get_default ());
 
+  /* First create all windows */
   for (l = display->toplevels; l != NULL; l = l->next)
     {
       GdkWindowImplBroadway *impl = l->data;
@@ -227,6 +228,16 @@ _gdk_broadway_resync_windows (void)
                                   window->width,
                                   window->height,
                                   window->window_type == GDK_WINDOW_TEMP);
+    }
+
+  /* Then do everything that may reference other windows */
+  for (l = display->toplevels; l != NULL; l = l->next)
+    {
+      GdkWindowImplBroadway *impl = l->data;
+
+      if (impl->id == 0)
+       continue; /* Skip root */
+
       if (impl->transient_for)
        broadway_output_set_transient_for (display->output, impl->id, impl->transient_for);
       /* Can't check GDK_WINDOW_IS_MAPPED here, because that doesn't correctly handle